﻿#include "pch.h"

/**
context计划
Header
GetStringSlice
PostForm
SetSameSite
SaveUploadedFile
BindJSON
AsciiJSON
ProtoBuf
YAML
IsWebsocket
AbortWithStatusJSON
Negotiate
BindUri
IsAborted
ClientIP
SetCookie
GetPostForm
AbortWithStatus
Err
NegotiateFormat
MustGet
HTML
GetStringMapString
GetUint
FormFile
FileAttachment
Status
Error
TOML
Abort
HandlerNames
ShouldBindBodyWith
BindWith
GetInt
File
Copy
Bind
GetQueryArray
SSEvent
QueryMap
JSON
Redirect
MustBindWith
RemoteIP
BindQuery
Accepted
SecureJSON
ShouldBindWith
Set
Deadline
GetFloat64
DefaultQuery
Value
ShouldBindHeader
Writer
ContentType
Next
Request
FullPath
XML
String
Data
Get
GetUint64
JSONP
FileFromFS
ShouldBindUri
GetPostFormArray
GetStringMap
PureJSON
GetHeader
MultipartForm
HandlerName
GetString
Errors
SetAccepted
AddParam
Param
ShouldBind
PostFormMap
QueryArray
DataFromReader
Stream
GetTime
GetInt64
PostFormArray
AbortWithError
Params
ShouldBindYAML
BindYAML
IndentedJSON
Render
GetStringMapStringSlice
GetQuery
ShouldBindTOML
GetPostFormMap
Query
DefaultPostForm
Keys
GetQueryMap
Done
BindHeader
ShouldBindQuery
GetDuration
Cookie
ShouldBindJSON
GetBool
ShouldBindXML
Handler
GetRawData
BindXML
BindTOML
*/


WoHTTPContext::WoHTTPContext(WoHTTPIncomingRequestPtr reqPtr, WoHTTPOutgoingResponsePtr respPtr) {
	Request = reqPtr;
	//Request = this;
	Response = respPtr;
	//ResponsePtr = respPtr;
}

int WoHTTPContext::Index(int index){
	if (index>-1) {
		m_index = index;
	}
	return m_index;
};
void WoHTTPContext::Next(bool b) {  m_Next= b; }
bool WoHTTPContext::GetNext() {  return m_Next; }
int WoHTTPContext::Max() { return m_max; }
WoHttpControllerModel& WoHTTPContext::CallModel(int index) {
	//((WoHTTPHanderFunc)(*context->CallFunc)[context->index])(*context->req, *context->resp);
	return (*m_CallFunc)[index];
};


